package com.springboot.wisdom.serviceApi.mqtt.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;
import java.util.Date;

/**
 * 智能设备表
 *
 * @TableName hardware_device
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@TableName(value = "hardware_device")
public class HardwareDeviceDO implements Serializable {
    /**
     * 设备ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String deviceId;
    /**
     * 设备所属ID。
     */
    private String deviceFromId;
    /**
     * 设备名称
     */
    private String deviceName;
    /**
     * 设备类型
     */
//    @TableField(typeHandler = EnumTypeHandler.class)
//    private MqttDeviceTypeEnum deviceType;
    private String deviceType;
    /**
     * 设备状态【0：关，1：开，2：异常关机】
     */
//    @TableField(typeHandler = EnumTypeHandler.class)
//    private MqttDeviceStatusEnum deviceStatus;
    private String deviceStatus;
    /**
     * 备注。
     */
    private String remark;

    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}